Dynomotion

Group: DynoMotion Message: 6523 From: himykabibble Date: 1/19/2013
Subject: VCS Examples
Tom,

I notice most, if not all, of the VCS samples contain this, or something very similar:

public Form1()
{
InitializeComponent();
MainPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
MainPath = System.IO.Path.GetDirectoryName(MainPath);
MainPath = System.IO.Path.GetDirectoryName(MainPath);

CFileName.Text = MainPath + @"\PC VCS Examples\TeachMotion\Probedata.txt";
KM = new KMotion_dotNet.KM_Controller();
}

Those three lines all setting MainPath have me baffled.....

Regards,
Ray L.
Group: DynoMotion Message: 6526 From: Tom Kerekes Date: 1/19/2013
Subject: Re: VCS Examples
Hi Ray,

This is just determining the directory that the software is installed in.  This is useful in case the Version changes or the directory is moved or renamed things can still be found correctly.

So for example the TeachMotion.exe example might be executing from:

C:\KMotion430j\KMotion\Release\TeachMotion.exe

Getting the Directory of the Directory of the Directory results in the root:

C:\KMotion430j

HTH
Regards
TK